<template>
	<view class="wrapper">
		<!-- <uni-nav-bar leftIcon="back" rightText="记录" @clickLeft="$back()" @clickRight="$open('./wallet_pay')" backgroundColor="#f3f3f3"></uni-nav-bar> -->
		<view class="user_wallet">
			<image src="../../static/bizhan/beh.png" class="goldB"></image>
			<view class="user_cash">我的余额</view>
			<view class="number">
				{{balance | toTwo(4)}}
				<text> BIM</text>
			</view>
			<view class="center ctheme f34" @tap="$open('./wallet_pay')">
				钱包记录
			</view>
			<view class="btn center">
				<button type="default" class="chongzhi wadh" @tap="$sToast('待开放')">充币</button>
				<!-- $open('../bizhan/showWalletCode?address=' + applyData.member.walletAddress) -->
				<button type="default" class="tixian wadh" @tap="$sToast('待开放')">提币</button>
				<!-- $open('./wallet_tixian?balance=' + applyData.member.usdtAccount) -->
				<!-- <button type="default" class="chongzhi wadh" @tap="$open('./wallet_more')">充币</button> -->
				<!-- <button type="default" class="tixian wadh" @tap="$open('./wallet_tixian?balance='+balance)">提币</button> -->
			</view>
		</view>
	</view>
</template>

<script>
import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue';
export default {
	data() {
		return {
			balance:0.00,
			applyData:''
		};
	},
	components: { uniNavBar },
	onLoad(e) {
		if(e.userId){
			let userinfo={
				userId:e.userId,
				access_token:e.access_token
			}
			uni.setStorageSync('userinfo',userinfo)
		}
		this.getMoney()
	},
	methods: {
		getMoney(){
			this.$ajax(
				this.apiList.getUserMoeny).then(res => {
				if(res.data.balance>0){
					this.balance=res.data.balance
				}
			});
			this.$ajax(
				'bi/getMyInfo',
				{
					userId: uni.getStorageSync('userinfo').userId
				},
				'POST'
			).then(res => {
				this.applyData = res.data;
			});
		},
	}
};
</script>

<style lang="scss">
.wrapper {
	background: linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(242, 243, 245, 0.87) 13%);
}
.user_wallet {
	text-align: center;
}

.user_wallet .goldB {
	width: 150rpx;
	height: 150rpx;
	margin-top: 100rpx;
}

.user_cash {
	height: 31rpx;
	font-size: 32rpx;
	font-weight: 500;
	color: rgba(51, 51, 51, 1);
	margin-top: 25rpx;
}

.number {
	font-size: 56rpx;
	font-weight: bold;
	color: rgba(51, 51, 51, 1);
	margin: 37rpx 0 10rpx;
	text{
		font-size: 32rpx;
		padding-left: 8rpx;
	}
}
.btn {
	text-align: center;
	margin-top: 390rpx;
}
.btn .wadh {
	width: 345rpx;
	height: 80rpx;
	border-radius: 8rpx;
}

.btn .chongzhi {
	background: rgba(2, 151, 254, 1);
	font-size: 30rpx;
	font-weight: 500;
	color: rgba(255, 255, 255, 1);
	width: 300rpx;
}

.btn .tixian {
	background: rgba(224, 224, 224, 1);
	font-size: 30rpx;
	font-weight: 500;
	color: rgba(2, 151, 254, 1);
	width: 300rpx;
}
</style>
